﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using mamnontuoitho7.AppCode;

namespace mamnontuoitho7.backend
{
    public partial class AlbumPhotoUpload : System.Web.UI.Page
    {
        string _productID = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["memberID"].ToString() != "" && (ConstantClass.permissionArticle).IndexOf(Session["role"].ToString() + ",") != -1)
            {
                if (Request.QueryString["AlbumID"] != null)
                {
                    // Session["AlbumPhoto_productID"] = Request.Form["hidProductID"].ToString();
                    _productID = Request.QueryString["AlbumID"].ToString();

                }

                string jscript = "function UploadComplete(){" + ClientScript.GetPostBackEventReference(LinkButton1, "") + "};";
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "FileCompleteUpload", jscript, true);

                flashUpload.QueryParameters = "ProductID=" + _productID;
                Server.UrlEncode(Request.QueryString.ToString());
            }
            else
            {
                Response.Redirect(ConstantClass._errorLoginPage);
            }
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Response.Redirect("AlbumPhoto.aspx?ProductID=" + _productID);
        }
    }
}